import request from '@/utils/request'
import type { TrademarkResponseData, Trademark } from './type'
enum API {
  TRADEMARKLIST_URL = '/admin/product/baseTrademark/',
  ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
  UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update',
  DELETETRADEMARK_URL = '/admin/product/baseTrademark/remove/'
}
// 获取分页列表
export const getTrademarkListService = (page: number, limit: number) =>
  request.get<any, TrademarkResponseData>(
    API.TRADEMARKLIST_URL + `/${page}/${limit}`
  )

// 新增品牌
export const addTrademarkService = (data: Trademark) =>
  request.post<any, any>(API.ADDTRADEMARK_URL, data)

// 修改品牌
export const updateTrademarkService = (data: Trademark) =>
  request.put<any, any>(API.UPDATETRADEMARK_URL, data)

// 删除品牌
export const deleteTrademarkService = (id: number) =>
  request.delete<any, any>(API.DELETETRADEMARK_URL + `${id}`)
